  <ul id="sidebar_menu" class="navbar nav nav-list sidebar_box">	
	<?php
		$i = 1;
		foreach($master_menu->result() as $row){
			if($row->is_submenu == 1){
				echo '<li class="accordion-group">';
				echo '<a class="accordion-toggle widgets collapsed" data-toggle="collapse" data-parent="#sidebar_menu" href="#collapse'.$i.'">'.$row->title.'</a>';
				echo '<ul id="collapse'.$i.'" class="accordion-body collapse">';
				foreach($level_menu->result() as $subrow){
					
					if($row->id == $subrow->parent_id){
						echo '<li><a href="'.site_url().'">'.$subrow->title.'</a></li>';
					}
				}
				echo '</ul>';
				echo '</li>';
				$i++;
			}else{
				if($row->id == 1){
					echo '<li class="accordion-group active"><a href="'.site_url().'">'.$row->title.'</a></li>';
				}else{
					echo '<li class="accordion-group"><a href="'.site_url().'">'.$row->title.'</a></li>';
				}
			}
		}
	?>
  </ul>